
package com.quartet.modules.system.service.dto;

import com.quartet.base.BaseDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

/**
 * @author Zheng Jie
 * @date 2018-11-23
 */
@Getter
@Setter
public class RoleDto extends BaseDTO implements Serializable {

    @ApiModelProperty(value = "角色id")
    private Long id;

    @ApiModelProperty(value = "菜单集合")
    private Set<MenuDto> menus;

    @ApiModelProperty(value = "部门集合")
    private Set<DeptDto> depts;

    @ApiModelProperty(value = "角色名称")
    private String name;

    @ApiModelProperty(value = "数据权限")
    private String dataScope;

    @ApiModelProperty(value = "角色等级")
    private Integer level;

    @ApiModelProperty(value = "角色描述")
    private String description;

    @ApiModelProperty(value = "角色类型 1:管理员 2：监控员")
    private String roleType;

    @ApiModelProperty(value = "角色状态 0：正常 1：禁用")
    private String roleStatus;

    @ApiModelProperty(value = "授权状态 0：已授权1：未授权")
    private String authorization_status;

    @ApiModelProperty(value = "菜单json")
    private String menuJson;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RoleDto roleDto = (RoleDto) o;
        return Objects.equals(id, roleDto.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
